package com.movisol.questionwizard.views;

import com.movisol.tools.HelperUtils;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class Profile extends LinearLayout {
	
	private Button btnSeduceme;
	private Button btnMirame;
	private String nombre;
	private String edad;
	private String pais;
	private TextView tvInfo;
	private TextView tvDescripcion;
	private ImageView ivFoto;
	private Context context;
	private boolean active;

	public Profile(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.context = context;
		active = false;
		initializeControls();
	}

	public void initializeControls() {

		String infService = Context.LAYOUT_INFLATER_SERVICE;
		LayoutInflater li = (LayoutInflater)getContext().getSystemService(infService);
		li.inflate(HelperUtils.getLayoutResource("profile", context), this, true);

		//Link the resources
		btnSeduceme = (Button) findViewById(HelperUtils.getIdResource("btnSeduceme", context));		
		btnMirame = (Button) findViewById(HelperUtils.getIdResource("btnMirame", context));
		btnMirame.setBackgroundResource(HelperUtils.getDrawableResource("btn_mirameoff", context));
		tvDescripcion = (TextView) findViewById(HelperUtils.getIdResource("tvDescripcion", context));
		tvInfo = (TextView) findViewById(HelperUtils.getIdResource("tvInfo", context));
		ivFoto = (ImageView) findViewById(HelperUtils.getIdResource("ivFoto", context));
		
		//Buttons disabled by default
		disableMirameButton();
		disableSeducemeButton();
	}
	
	public void disableMirameButton()
	{
		if(btnMirame != null)
		{
			btnMirame.setBackgroundResource(HelperUtils.getDrawableResource("btn_mirameoff", context));
//			btnMirame.setEnabled(false);
		}
	}
	
	public void enableMirameButton()
	{
		if(btnMirame != null)
		{
			btnMirame.setBackgroundResource(HelperUtils.getDrawableResource("btn_mirameon", context));
//			btnMirame.setEnabled(true);
		}
	}
	
	public void disableSeducemeButton()
	{
		if(btnSeduceme != null)
		{
			btnSeduceme.setBackgroundResource(HelperUtils.getDrawableResource("btn_seducemeoff", context));
//			btnSeduceme.setEnabled(false);
		}
	}
	
	public void enableSeducemeButton()
	{
		if(btnSeduceme != null)
		{
			btnSeduceme.setBackgroundResource(HelperUtils.getDrawableResource("btn_seducemeon", context));
//			btnSeduceme.setEnabled(true);
		}
	}
	
	public void enableGirl()
	{
		enableMirameButton();
		enableSeducemeButton();
	}

	public Button getBtnSeduceme() {
		return btnSeduceme;
	}

	public void setBtnSeduceme(Button btnSeduceme) {
		this.btnSeduceme = btnSeduceme;
	}

	public Button getBtnMirame() {
		return btnMirame;
	}

	public void setBtnMirame(Button btnMirame) {
		this.btnMirame = btnMirame;
	}

	public String getNombre() {
		return nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	public String getEdad() {
		return edad;
	}

	public void setEdad(String edad) {
		this.edad = edad;
	}

	public String getPais() {
		return pais;
	}

	public void setPais(String pais) {
		this.pais = pais;
	}

	public TextView getTvInfo() {
		return tvInfo;
	}

	public void setTvInfo(TextView tvInfo) {
		this.tvInfo = tvInfo;
	}

	public TextView getTvDescripcion() {
		return tvDescripcion;
	}

	public void setTvDescripcion(TextView tvDescripcion) {
		this.tvDescripcion = tvDescripcion;
	}

	public ImageView getIvFoto() {
		return ivFoto;
	}

	public void setIvFoto(ImageView ivFoto) {
		this.ivFoto = ivFoto;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}



}
